﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Кабельные линии</title>

    <link rel="stylesheet" href="/resources/css/bootstrap.css" type="text/css">
    <link rel="stylesheet" href="/resources/css/bootstrap-extended.css" type="text/css">
    <link rel="stylesheet" href="/resources/css/bootstrap-responsive.css" type="text/css">

    <link rel="stylesheet" href="/resources/css/template2.css" type="text/css">

    <script src="/resources/js/jquery.js" type="text/javascript"></script>
    <script src="/resources/js/bootstrap.js" type="text/javascript"></script>

<body>
<!-- Header -->
<div class="header">
    <img src="/resources/images/logo.png">
</div>

<!-- Container -->
<div class="container">

    <div class="alert alert-success">

        <a class="btn btn-warning" href="/logout/" title="Выход">
            <i class="icon-off icon-white"></i> Выход
        </a>

    </div>

    <form action="/search/" method="post" id="form-search" class="form-inline">
        <div class="search">
            <div class="controls">
                <h4>Поиск:</h4>
                <input name="searchString" type="text" class="form-control" id="searchString" placeholder="Строка поиска" required autofocus>
                <button class="btn btn-warning" title="Поиск">
                    <i class="icon-off icon-white"></i> Поиск
                </button>
            </div>
        </div>
    </form>

    <div class="search-results">
        <h3>${errorMessage}</h3>
        <c:if test="${searchString != null}">
            <h4>По запросу "${searchString}" найдено результатов: ${cableLines.size()}</h4>
        </c:if>
        <c:if test="${cableLines.size() > 0}">
            <table width="100%" border="1" align="center" cellpadding="2" cellspacing="2">
                <tr>
                    <th>Название</th>
                    <th>Из</th>
                    <th>В</th>
                    <th>Близлежащие объекты</th>
                    <th>Изображение</th>
                </tr>
                <c:forEach items="${cableLines}" var="cableLine">
                    <tr>
                        <td>${cableLine.getAttributeText("name")}</td>
                        <td>${cableLine.getAttributeText("source")}</td>
                        <td>${cableLine.getAttributeText("destination")}</td>
                        <td>${cableLine.getAttributeText("geo")}</td>
                        <td>${cableLine.getAttributeText("image")}</td>
                    </tr>
                </c:forEach>
            </table>
        </c:if>
    </div>


    <hr>

    <div class="navbar navbar-fixed-bottom">
        <p class="center">© 2014</p>
    </div>

</div>

</body>
</html>